const Router = require('koa-router')

const {
  listValidator,
  delValidator,
} = require('../../../middleware/validator/v1/user_online')
// validateToken, validateAdmin 有先后顺序 先校验token再校验管理员
const {
  validateToken,
  validateAdmin,
} = require('../../../middleware/auth/token')

const { list, del } = require('../../../controller/v1/admin/user_online')
const PREFIX = '/v1/admin/user_online'

const { reqLog } = require('../../../middleware/log/log')

const router = new Router({ prefix: PREFIX })

router.get('/list', listValidator, validateToken, validateAdmin, list)

router.del('/del', delValidator, validateToken, validateAdmin, reqLog, del)

module.exports = router
